#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QLabel>
#include <QComboBox>
#include <QBitArray>

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

public:
    /**
     * @brief 获取绘制屏幕大小
     * @return
     */
    QSize GetViewSize();

    /**
     * @brief 打开项目工作区
     * @param workspace
     */
    void OpenWorkspace(const QString& workspace);

private:
    void startScene(const QString& path);
    void showProject(const QString& project);
    void setSceneTree();
    void loadTheme(const QString& name);
    void setupSignal();
    bool eventFilter(QObject *obj, QEvent *event) override;

signals:
    void sig_saveProject();
    void sig_logMessage(const QString& header, const QString& content);

private slots:
    void on_tabWidget_currentChanged(int index);

    void on_actionNew_triggered();

    void on_actionOpen_triggered();

    void on_actionSave_triggered();

    void on_actionPrint_triggered();

    void on_actionPublish_triggered();

    void on_actionExit_triggered();

    void on_actionViewFull_triggered();

    void on_actionViewReset_triggered();

    void on_actionThemeLight_triggered();

    void on_actionThemeDark_triggered();

    void on_actionSetupScene_triggered();

    void on_actionSetupPlugin_triggered();

    void on_actionHelpChm_triggered();

    void on_actionHelpHome_triggered();

private:
    Ui::MainWindow *ui;
    QByteArray _defaultWindowState;
    QComboBox* _toolbarCameraType;
    QLabel* _statusbarLabelCommand;
    QLineEdit* _statusbarLineEditCommand;
    QStringList _commandHistory;
    qsizetype _commandHistoryIndex;
    QBitArray _savedViewStatus;
    QByteArray _savedSplitterStatus;
    friend class Program;
};

#endif // MAINWINDOW_H
